#ifndef MYDIR_H
#define MYDIR_H

#include <stdio.h>
#include <dirent.h>

class Dir_Offset
{
    friend class MyDir;
    long l;
    Dir_Offset(long num) : l(num) {}
    operator const long () const { return l; }
};

class MyDir
{
public:
    MyDir(const char *dir);
    ~MyDir();

    bool isValid() const;
    bool read(dirent& res);
    void seek(const Dir_Offset &offset);
    Dir_Offset tell() const;

private:
    DIR *dp;
};

#endif // MYDIR_H
